#pragma once

#include <io/rttIODevice.h>

class qmc5883l: public NXMFC::rttIODevice
{
public:
    qmc5883l();
    ~qmc5883l();

    bool init();
    bool readMag(short &x, short &y, short &z);

private:
    int writeReg(unsigned char reg, unsigned char val);
    int readRegs(unsigned char reg, unsigned char *val, int size);
};
